package csd.wyaiyr.com.config;

import com.github.pagehelper.PageInfo;

import java.util.List;

public interface BaseService<T> {

    T selectByKey(Object key);

    int save(T entity);

    int saveSelective(T entity);

    int updateAll(T entity);

    int updateNotNull(T entity);

    int saveBatch(List<T> recordList);

    int deleteByPK(Object key);

    int deleteByIds(String ids);

    /**
     * 根据主键更新实体全部字段，null值会被更新
     *
     * @param record
     * @return
     */
    int updateByPK(T record);

    T getOneByPK(Object key);

    T getOneByEntity(T record);

    List<T> listAll();

    List<T> listByIds(String ids);

    int getCount(T record);

    List<T> listByEntity(T record);

    PageInfo<T> selectListPage(Integer pageNo, Integer pageSize, T t);


}
